Bug Summary

File:_librsyncmodule.c
Warning:line 188, column 8
PyObject ownership leak with reference count of 1

Annotated Source Code

Press '?' to see keyboard shortcuts

clang -cc1 -cc1 -triple x86_64-unknown-linux-gnu -analyze -disable-free -disable-llvm-verifier -discard-value-names -main-file-name _librsyncmodule.c -analyzer-store=region -analyzer-opt-analyze-nested-blocks -analyzer-checker=core -analyzer-checker=apiModeling -analyzer-checker=unix -analyzer-checker=deadcode -analyzer-checker=security.insecureAPI.UncheckedReturn -analyzer-checker=security.insecureAPI.getpw -analyzer-checker=security.insecureAPI.gets -analyzer-checker=security.insecureAPI.mktemp -analyzer-checker=security.insecureAPI.mkstemp -analyzer-checker=security.insecureAPI.vfork -analyzer-checker=nullability.NullPassedToNonnull -analyzer-checker=nullability.NullReturnedFromNonnull -analyzer-output plist -w -analyzer-output=html -analyzer-checker=python -analyzer-disable-checker=deadcode -analyzer-config prune-paths=true,suppress-c++-stdlib=true,suppress-inlined-defensive-checks=false,suppress-null-return-paths=false,crosscheck-with-z3=true,model-path=/opt/pyrefcon/lib/pyrefcon/models/models -analyzer-config experimental-enable-naive-ctu-analysis=true,ctu-dir=/tmp/pyrefcon/duplicity/csa-scan,ctu-index-name=/tmp/pyrefcon/duplicity/csa-scan/externalDefMap.txt,ctu-invocation-list=/tmp/pyrefcon/duplicity/csa-scan/invocations.yaml,display-ctu-progress=false -setup-static-analyzer -analyzer-config-compatibility-mode=true -mrelocation-model pic -pic-level 2 -fhalf-no-semantic-interposition -mframe-pointer=none -fmath-errno -fno-rounding-math -mconstructor-aliases -munwind-tables -target-cpu x86-64 -tune-cpu generic -debug-info-kind=limited -dwarf-version=4 -debugger-tuning=gdb -fcoverage-compilation-dir=/tmp/pyrefcon/duplicity -resource-dir /opt/pyrefcon/lib/clang/13.0.0 -isystem /opt/pyrefcon/lib/pyrefcon/models/python3.8 -D NDEBUG -D _FORTIFY_SOURCE=2 -internal-isystem /opt/pyrefcon/lib/clang/13.0.0/include -internal-isystem /usr/local/include -internal-isystem /usr/lib/gcc/x86_64-linux-gnu/10/../../../../x86_64-linux-gnu/include -internal-externc-isystem /usr/include/x86_64-linux-gnu -internal-externc-isystem /include -internal-externc-isystem /usr/include -O2 -Wno-unused-result -Wsign-compare -Wall -Wformat -Wformat -Wdate-time -fdebug-compilation-dir=/tmp/pyrefcon/duplicity -ferror-limit 19 -fwrapv -pthread -stack-protector 2 -fgnuc-version=4.2.1 -vectorize-loops -vectorize-slp -faddrsig -D__GCC_HAVE_DWARF2_CFI_ASM=1 -o /tmp/pyrefcon/duplicity/csa-scan/reports -x c duplicity/_librsyncmodule.c

duplicity/_librsyncmodule.c

1/* ----------------------------------------------------------------------- *
2 *
3 * Copyright 2002 2003 Ben Escoto <ben@emerose.org>
4 * Copyright 2007 Kenneth Loafman <kenneth@loafman.com>
5 *
6 * This file is part of duplicity.
7 *
8 * duplicity is free software; you can redistribute it and/or modify
9 * it under the terms of the GNU General Public License as published
10 * by the Free Software Foundation; either version 2 of the License,
11 * or (at your option) any later version.
12 *
13 * duplicity is distributed in the hope that it will be useful, but
14 * WITHOUT ANY WARRANTY; without even the implied warranty of
15 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
16 * General Public License for more details.
17 *
18 * You should have received a copy of the GNU General Public License
19 * along with duplicity; if not, write to the Free Software
20 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
21 * 02111-1307 USA
22 *
23 * ----------------------------------------------------------------------- */
24
25#define PY_SSIZE_T_CLEAN
26#include <Python.h>
27#include <errno(*__errno_location ()).h>
28#include <librsync.h>
29#define RS_JOB_BLOCKSIZE65536 65536
30
31static PyObject *librsyncError;
32
33/* Sets python error string from result */
34static void
35_librsync_seterror(rs_result result, char *location)
36{
37 char error_string[200];
38 sprintf(error_string, "librsync error %d while in %s", result, location)__builtin___sprintf_chk (error_string, 2 - 1, __builtin_object_size
(error_string, 2 > 1), "librsync error %d while in %s", result
, location)
;
39 PyErr_SetString(librsyncError, error_string);
40}
41
42
43/* --------------- SigMaker Object for incremental signatures */
44static PyTypeObject _librsync_SigMakerType;
45
46typedef struct {
47 PyObject_HEADPyObject ob_base;
48 rs_job_t *sig_job;
49} _librsync_SigMakerObject;
50
51static PyObject*
52_librsync_new_sigmaker(PyObject* self, PyObject* args)
53{
54 _librsync_SigMakerObject* sm;
55 long blocklen;
56
57 if (!PyArg_ParseTuple_PyArg_ParseTuple_SizeT(args, "l:new_sigmaker", &blocklen))
58 return NULL((void*)0);
59
60 sm = PyObject_New(_librsync_SigMakerObject, &_librsync_SigMakerType)( (_librsync_SigMakerObject *) _PyObject_New(&_librsync_SigMakerType
) )
;
61 if (sm == NULL((void*)0)) return NULL((void*)0);
62
63#ifdef RS_DEFAULT_STRONG_LEN /* librsync < 1.0.0 */
64 sm->sig_job = rs_sig_begin((size_t)blocklen,
65 (size_t)RS_DEFAULT_STRONG_LEN);
66#else /* librsync >= 1.0.0 */
67 sm->sig_job = rs_sig_begin((size_t)blocklen,
68 (size_t)8, RS_MD4_SIG_MAGIC);
69#endif
70 return (PyObject*)sm;
71}
72
73static void
74_librsync_sigmaker_dealloc(PyObject* self)
75{
76 rs_job_free(((_librsync_SigMakerObject *)self)->sig_job);
77 PyObject_DelPyObject_Free(self);
78}
79
80/* Take an input string, and generate a signature from it. The output
81 will be a triple (done, bytes_used, signature_string), where done
82 is true iff there is no more data coming and bytes_used is the
83 number of bytes of the input string processed.
84*/
85static PyObject *
86_librsync_sigmaker_cycle(_librsync_SigMakerObject *self, PyObject *args)
87{
88 char *inbuf, outbuf[RS_JOB_BLOCKSIZE65536];
89 Py_ssize_t inbuf_length;
90 rs_buffers_t buf;
91 rs_result result;
92
93#if PY_MAJOR_VERSION3 >= 3
94 if (!PyArg_ParseTuple_PyArg_ParseTuple_SizeT(args, "y#:cycle", &inbuf, &inbuf_length))
95#else
96 if (!PyArg_ParseTuple_PyArg_ParseTuple_SizeT(args, "s#:cycle", &inbuf, &inbuf_length))
97#endif
98 return NULL((void*)0);
99
100 buf.next_in = inbuf;
101 buf.avail_in = (size_t)inbuf_length;
102 buf.next_out = outbuf;
103 buf.avail_out = (size_t)RS_JOB_BLOCKSIZE65536;
104 buf.eof_in = (inbuf_length == 0);
105
106 result = rs_job_iter(self->sig_job, &buf);
107
108 if (result != RS_DONE && result != RS_BLOCKED) {
109 _librsync_seterror(result, "signature cycle");
110 return NULL((void*)0);
111 }
112
113#if PY_MAJOR_VERSION3 >= 3
114 return Py_BuildValue_Py_BuildValue_SizeT("(ily#)", (result == RS_DONE),
115#else
116 return Py_BuildValue_Py_BuildValue_SizeT("(ils#)", (result == RS_DONE),
117#endif
118 (long)inbuf_length - (long)buf.avail_in,
119 outbuf, RS_JOB_BLOCKSIZE65536 - (long)buf.avail_out);
120}
121
122static PyMethodDef _librsync_sigmaker_methods[] = {
123 {"cycle", (PyCFunction)_librsync_sigmaker_cycle, METH_VARARGS0x0001},
124 {NULL((void*)0), NULL((void*)0), 0, NULL((void*)0)} /* sentinel */
125};
126
127static PyTypeObject _librsync_SigMakerType = {
128 PyVarObject_HEAD_INIT(NULL, 0){ { 1, ((void*)0) }, 0 },
129 "sigmaker",
130 sizeof(_librsync_SigMakerObject),
131 0,
132 _librsync_sigmaker_dealloc, /*tp_dealloc*/
133 0, /*tp_print*/
134 0, /*tp_getattr*/
135 0, /*tp_setattr*/
136 0, /*tp_compare*/
137 0, /*tp_repr*/
138 0, /*tp_as_number*/
139 0, /*tp_as_sequence*/
140 0, /*tp_as_mapping*/
141 0, /*tp_hash */
142 0, /*tp_call*/
143 0, /*tp_str*/
144 PyObject_GenericGetAttr, /*tp_getattro*/
145 PyObject_GenericSetAttr, /*tp_setattro*/
146 0, /*tp_as_buffer*/
147 Py_TPFLAGS_DEFAULT( 0 | (1UL << 18) | 0), /*tp_flags*/
148 0, /*tp_doc*/
149 0, /*tp_traverse*/
150 0, /*tp_clear*/
151 0, /*tp_richcompare*/
152 0, /*tp_weaklistoffset*/
153 0, /*tp_iter*/
154 0, /*tp_iternext*/
155 _librsync_sigmaker_methods, /*tp_methods*/
156};
157
158
159/* --------------- DeltaMaker Object for incremental deltas */
160
161static PyTypeObject _librsync_DeltaMakerType;
162
163typedef struct {
164 PyObject_HEADPyObject ob_base;
165 rs_job_t *delta_job;
166 rs_signature_t *sig_ptr;
167} _librsync_DeltaMakerObject;
168
169/* Call with the entire signature loaded into one big string */
170static PyObject*
171_librsync_new_deltamaker(PyObject* self, PyObject* args)
172{
173 _librsync_DeltaMakerObject* dm;
174 char *sig_string, outbuf[RS_JOB_BLOCKSIZE65536];
175 Py_ssize_t sig_length;
176 rs_job_t *sig_loader;
177 rs_signature_t *sig_ptr;
178 rs_buffers_t buf;
179 rs_result result;
180
181#if PY_MAJOR_VERSION3 >= 3
182 if (!PyArg_ParseTuple_PyArg_ParseTuple_SizeT(args,"y#:new_deltamaker", &sig_string, &sig_length))
1
Assuming the condition is false
2
Taking false branch
183#else
184 if (!PyArg_ParseTuple_PyArg_ParseTuple_SizeT(args,"s#:new_deltamaker", &sig_string, &sig_length))
185#endif
186 return NULL((void*)0);
187
188 dm = PyObject_New(_librsync_DeltaMakerObject, &_librsync_DeltaMakerType)( (_librsync_DeltaMakerObject *) _PyObject_New(&_librsync_DeltaMakerType
) )
;
3
Calling '_PyObject_New'
5
Returning from '_PyObject_New'
10
PyObject ownership leak with reference count of 1
189 if (dm == NULL((void*)0)) return NULL((void*)0);
6
Assuming 'dm' is not equal to NULL
7
Taking false branch
190
191 /* Put signature at sig_ptr and build hash */
192 sig_loader = rs_loadsig_begin(&sig_ptr);
193 buf.next_in = sig_string;
194 buf.avail_in = (size_t)sig_length;
195 buf.next_out = outbuf;
196 buf.avail_out = (size_t)RS_JOB_BLOCKSIZE65536;
197 buf.eof_in = 1;
198 result = rs_job_iter(sig_loader, &buf);
199 rs_job_free(sig_loader);
200 if (result != RS_DONE) {
8
Assuming 'result' is not equal to RS_DONE
9
Taking true branch
201 _librsync_seterror(result, "delta rs_signature_t builder");
202 return NULL((void*)0);
203 }
204 if ((result = rs_build_hash_table(sig_ptr)) != RS_DONE) {
205 _librsync_seterror(result, "delta rs_build_hash_table");
206 return NULL((void*)0);
207 }
208
209 dm->sig_ptr = sig_ptr;
210 dm->delta_job = rs_delta_begin(sig_ptr);
211 return (PyObject*)dm;
212}
213
214static void
215_librsync_deltamaker_dealloc(PyObject* self)
216{
217 _librsync_DeltaMakerObject *dm = (_librsync_DeltaMakerObject *)self;
218 rs_signature_t *sig_ptr = dm->sig_ptr;
219
220 rs_free_sumset(sig_ptr);
221 rs_job_free(dm->delta_job);
222 PyObject_DelPyObject_Free(self);
223}
224
225/* Take a chunk of the new file in an input string, and return a
226 triple (done bytes_used, delta_string), where done is true iff no
227 more data is coming and bytes_used is the number of bytes of the
228 input string processed.
229*/
230static PyObject *
231_librsync_deltamaker_cycle(_librsync_DeltaMakerObject *self, PyObject *args)
232{
233 char *inbuf, outbuf[RS_JOB_BLOCKSIZE65536];
234 Py_ssize_t inbuf_length;
235 rs_buffers_t buf;
236 rs_result result;
237
238#if PY_MAJOR_VERSION3 >= 3
239 if (!PyArg_ParseTuple_PyArg_ParseTuple_SizeT(args, "y#:cycle", &inbuf, &inbuf_length))
240#else
241 if (!PyArg_ParseTuple_PyArg_ParseTuple_SizeT(args, "s#:cycle", &inbuf, &inbuf_length))
242#endif
243 return NULL((void*)0);
244
245 buf.next_in = inbuf;
246 buf.avail_in = (size_t)inbuf_length;
247 buf.next_out = outbuf;
248 buf.avail_out = (size_t)RS_JOB_BLOCKSIZE65536;
249 buf.eof_in = (inbuf_length == 0);
250
251 result = rs_job_iter(self->delta_job, &buf);
252 if (result != RS_DONE && result != RS_BLOCKED) {
253 _librsync_seterror(result, "delta cycle");
254 return NULL((void*)0);
255 }
256
257#if PY_MAJOR_VERSION3 >= 3
258 return Py_BuildValue_Py_BuildValue_SizeT("(ily#)", (result == RS_DONE),
259#else
260 return Py_BuildValue_Py_BuildValue_SizeT("(ils#)", (result == RS_DONE),
261#endif
262 (long)inbuf_length - (long)buf.avail_in,
263 outbuf, RS_JOB_BLOCKSIZE65536 - (long)buf.avail_out);
264}
265
266static PyMethodDef _librsync_deltamaker_methods[] = {
267 {"cycle", (PyCFunction)_librsync_deltamaker_cycle, METH_VARARGS0x0001},
268 {NULL((void*)0), NULL((void*)0), 0, NULL((void*)0)} /* sentinel */
269};
270
271static PyTypeObject _librsync_DeltaMakerType = {
272 PyVarObject_HEAD_INIT(NULL, 0){ { 1, ((void*)0) }, 0 },
273 "deltamaker",
274 sizeof(_librsync_DeltaMakerObject),
275 0,
276 _librsync_deltamaker_dealloc, /*tp_dealloc*/
277 0, /*tp_print*/
278 0, /*tp_getattr*/
279 0, /*tp_setattr*/
280 0, /*tp_compare*/
281 0, /*tp_repr*/
282 0, /*tp_as_number*/
283 0, /*tp_as_sequence*/
284 0, /*tp_as_mapping*/
285 0, /*tp_hash */
286 0, /*tp_call*/
287 0, /*tp_str*/
288 PyObject_GenericGetAttr, /*tp_getattro*/
289 PyObject_GenericSetAttr, /*tp_setattro*/
290 0, /*tp_as_buffer*/
291 Py_TPFLAGS_DEFAULT( 0 | (1UL << 18) | 0), /*tp_flags*/
292 0, /*tp_doc*/
293 0, /*tp_traverse*/
294 0, /*tp_clear*/
295 0, /*tp_richcompare*/
296 0, /*tp_weaklistoffset*/
297 0, /*tp_iter*/
298 0, /*tp_iternext*/
299 _librsync_deltamaker_methods, /*tp_methods*/
300};
301
302
303/* --------------- PatchMaker Object for incremental patching */
304
305
306static PyTypeObject _librsync_PatchMakerType;
307
308typedef struct {
309 PyObject_HEADPyObject ob_base;
310 rs_job_t *patch_job;
311 PyObject *basis_file;
312 FILE *cfile;
313} _librsync_PatchMakerObject;
314
315/* Call with the basis file */
316static PyObject*
317_librsync_new_patchmaker(PyObject* self, PyObject* args)
318{
319 _librsync_PatchMakerObject* pm;
320 PyObject *python_file;
321 int fd;
322
323 if (!PyArg_ParseTuple_PyArg_ParseTuple_SizeT(args, "O:new_patchmaker", &python_file))
324 return NULL((void*)0);
325 fd = PyObject_AsFileDescriptor(python_file);
326 if (fd == -1) {
327 PyErr_SetString(PyExc_TypeError, "Need true file object");
328 return NULL((void*)0);
329 }
330 /* get our own private copy of the file, so we can close it later. */
331 fd = dup(fd);
332 if (fd == -1) {
333 char buf[256];
334 strerror_r(errno(*__errno_location ()), buf, sizeof(buf));
335 PyErr_SetString(PyExc_TypeError, buf);
336 return NULL((void*)0);
337 }
338 Py_INCREF(python_file)_Py_INCREF(((PyObject*)(python_file)));
339
340 pm = PyObject_New(_librsync_PatchMakerObject, &_librsync_PatchMakerType)( (_librsync_PatchMakerObject *) _PyObject_New(&_librsync_PatchMakerType
) )
;
341 if (pm == NULL((void*)0)) return NULL((void*)0);
342
343 pm->basis_file = python_file;
344 pm->cfile = fdopen(fd, "rb");
345 pm->patch_job = rs_patch_begin(rs_file_copy_cb, pm->cfile);
346
347 return (PyObject*)pm;
348}
349
350static void
351_librsync_patchmaker_dealloc(PyObject* self)
352{
353 _librsync_PatchMakerObject *pm = (_librsync_PatchMakerObject *)self;
354 Py_DECREF(pm->basis_file)_Py_DECREF(((PyObject*)(pm->basis_file)));
355 rs_job_free(pm->patch_job);
356 if (pm->cfile) {
357 fclose(pm->cfile);
358 }
359 PyObject_DelPyObject_Free(self);
360}
361
362/* Take a chunk of the delta file in an input string, and return a
363 triple (done, bytes_used, patched_string), where done is true iff
364 there is no more data coming out and bytes_used is the number of
365 bytes of the input string processed.
366*/
367static PyObject *
368_librsync_patchmaker_cycle(_librsync_PatchMakerObject *self, PyObject *args)
369{
370 char *inbuf, outbuf[RS_JOB_BLOCKSIZE65536];
371 Py_ssize_t inbuf_length;
372 rs_buffers_t buf;
373 rs_result result;
374
375#if PY_MAJOR_VERSION3 >= 3
376 if (!PyArg_ParseTuple_PyArg_ParseTuple_SizeT(args, "y#:cycle", &inbuf, &inbuf_length))
377#else
378 if (!PyArg_ParseTuple_PyArg_ParseTuple_SizeT(args, "s#:cycle", &inbuf, &inbuf_length))
379#endif
380 return NULL((void*)0);
381
382 buf.next_in = inbuf;
383 buf.avail_in = (size_t)inbuf_length;
384 buf.next_out = outbuf;
385 buf.avail_out = (size_t)RS_JOB_BLOCKSIZE65536;
386 buf.eof_in = (inbuf_length == 0);
387
388 result = rs_job_iter(self->patch_job, &buf);
389 if (result != RS_DONE && result != RS_BLOCKED) {
390 _librsync_seterror(result, "patch cycle");
391 return NULL((void*)0);
392 }
393
394#if PY_MAJOR_VERSION3 >= 3
395 return Py_BuildValue_Py_BuildValue_SizeT("(ily#)", (result == RS_DONE),
396#else
397 return Py_BuildValue_Py_BuildValue_SizeT("(ils#)", (result == RS_DONE),
398#endif
399 (long)inbuf_length - (long)buf.avail_in,
400 outbuf, RS_JOB_BLOCKSIZE65536 - (long)buf.avail_out);
401}
402
403static PyMethodDef _librsync_patchmaker_methods[] = {
404 {"cycle", (PyCFunction)_librsync_patchmaker_cycle, METH_VARARGS0x0001},
405 {NULL((void*)0), NULL((void*)0), 0, NULL((void*)0)} /* sentinel */
406};
407
408static PyTypeObject _librsync_PatchMakerType = {
409 PyVarObject_HEAD_INIT(NULL, 0){ { 1, ((void*)0) }, 0 },
410 "patchmaker",
411 sizeof(_librsync_PatchMakerObject),
412 0,
413 _librsync_patchmaker_dealloc, /*tp_dealloc*/
414 0, /*tp_print*/
415 0, /*tp_getattr*/
416 0, /*tp_setattr*/
417 0, /*tp_compare*/
418 0, /*tp_repr*/
419 0, /*tp_as_number*/
420 0, /*tp_as_sequence*/
421 0, /*tp_as_mapping*/
422 0, /*tp_hash */
423 0, /*tp_call*/
424 0, /*tp_str*/
425 PyObject_GenericGetAttr, /*tp_getattro*/
426 PyObject_GenericSetAttr, /*tp_setattro*/
427 0, /*tp_as_buffer*/
428 Py_TPFLAGS_DEFAULT( 0 | (1UL << 18) | 0), /*tp_flags*/
429 0, /*tp_doc*/
430 0, /*tp_traverse*/
431 0, /*tp_clear*/
432 0, /*tp_richcompare*/
433 0, /*tp_weaklistoffset*/
434 0, /*tp_iter*/
435 0, /*tp_iternext*/
436 _librsync_patchmaker_methods, /*tp_methods*/
437};
438
439
440/* --------------- _librsync module definition */
441
442#if PY_MAJOR_VERSION3 >= 3
443#define MOD_DEF(ob, name, doc, methods)static struct PyModuleDef moduledef = { { { 1, ((void*)0) }, (
(void*)0), 0, ((void*)0), }, name, doc, -1, methods, }; ob = PyModule_Create2
(&moduledef, 1013);
\
444 static struct PyModuleDef moduledef = { \
445 PyModuleDef_HEAD_INIT{ { 1, ((void*)0) }, ((void*)0), 0, ((void*)0), }, name, doc, -1, methods, }; \
446 ob = PyModule_Create(&moduledef)PyModule_Create2(&moduledef, 1013);
447#else
448#define MOD_DEF(ob, name, doc, methods)static struct PyModuleDef moduledef = { { { 1, ((void*)0) }, (
(void*)0), 0, ((void*)0), }, name, doc, -1, methods, }; ob = PyModule_Create2
(&moduledef, 1013);
\
449 ob = Py_InitModule3(name, methods, doc);
450#endif
451
452static PyMethodDef _librsyncMethods[] = {
453 {"new_sigmaker", _librsync_new_sigmaker, METH_VARARGS0x0001,
454 "Return a sigmaker object, for finding the signature of an object"},
455 {"new_deltamaker", _librsync_new_deltamaker, METH_VARARGS0x0001,
456 "Return a deltamaker object, for computing deltas"},
457 {"new_patchmaker", _librsync_new_patchmaker, METH_VARARGS0x0001,
458 "Return a patchmaker object, for patching basis files"},
459 {NULL((void*)0), NULL((void*)0), 0, NULL((void*)0)}
460};
461
462static PyObject *
463moduleinit(void)
464{
465 PyObject *m, *d;
466
467 #if PY_MAJOR_VERSION3 >= 3 && PY_MINOR_VERSION8 >= 10
468 Py_SET_TYPE(&_librsync_SigMakerType, &PyType_Type);
469 Py_SET_TYPE(&_librsync_DeltaMakerType, &PyType_Type);
470 #else
471 Py_TYPE(&_librsync_SigMakerType)(((PyObject*)(&_librsync_SigMakerType))->ob_type) = &PyType_Type;
472 Py_TYPE(&_librsync_DeltaMakerType)(((PyObject*)(&_librsync_DeltaMakerType))->ob_type) = &PyType_Type;
473 #endif
474
475 MOD_DEF(m, "_librsync", "", _librsyncMethods)static struct PyModuleDef moduledef = { { { 1, ((void*)0) }, (
(void*)0), 0, ((void*)0), }, "_librsync", "", -1, _librsyncMethods
, }; m = PyModule_Create2(&moduledef, 1013);
476 if (m == NULL((void*)0))
477 return NULL((void*)0);
478
479 d = PyModule_GetDict(m);
480 librsyncError = PyErr_NewException("_librsync.librsyncError", NULL((void*)0), NULL((void*)0));
481 PyDict_SetItemString(d, "librsyncError", librsyncError);
482 PyDict_SetItemString(d, "RS_JOB_BLOCKSIZE",
483 Py_BuildValue_Py_BuildValue_SizeT("l", (long)RS_JOB_BLOCKSIZE65536));
484 PyDict_SetItemString(d, "RS_DEFAULT_BLOCK_LEN",
485 Py_BuildValue_Py_BuildValue_SizeT("l", (long)RS_DEFAULT_BLOCK_LEN2048));
486
487 return m;
488}
489
490#if PY_MAJOR_VERSION3 < 3
491void init_librsync(void)
492{
493 moduleinit();
494}
495#else
496PyObject *PyInit__librsync(void)
497{
498 return moduleinit();
499}
500#endif

/opt/pyrefcon/lib/pyrefcon/models/models/_PyObject_New.model

1#ifndef _PyObject_New
2struct _object;
3typedef struct _object PyObject;
4PyObject* clang_analyzer_PyObject_New_Reference();
5PyObject* _PyObject_New(PyTypeObject *type) {
6 return clang_analyzer_PyObject_New_Reference();
4
Setting reference count to 1
7}
8#else
9#warning "API _PyObject_New is defined as a macro."
10#endif